<!--
  @author songweidong
  @date 2019-07-10 16:14:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html th:replace="~{work/modify/common/layout :: layout('服务完成审核', ~{::title}, ~{::content}, ~{::script})}">
<head>
    <title>工单管理-服务完成审核</title>
</head>
<body>

<div th:fragment="content">
    <style>
        .container-images li img {
            display: none;
        }
        .table-text tr td {
            text-align: center;
        }
        .table-text tr th {
            text-align: center;
        }
        .table-text input {
            text-align: center;
        }

        .audit-reason:hover {
            cursor: pointer;
        }

        .audit-reason {
            font-size: 8px;
            color: #1E9FFF;
            text-decoration: underline;
        }

        .audit {
            font-size: 8px;
            color: gray;
        }

        .btn-delete{
            display: none;
        }
    </style>
    <form class="layui-form">

        <input id="work-id" type="hidden" name="workId" th:value="${reviewVO.workId}"/>
        <input id="order-id" type="hidden" name="orderId" th:value="${reviewVO.orderId}"/>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 60px"><b>工单价格</b></label>
                <div class="layui-inline" style="width: 700px;">
                    <table class="layui-table table-text">
                        <thead>
                        <tr>
                            <th>订单金额</th>
                            <th>优惠</th>
                            <th>订单收入</th>
                            <th>订单内部价</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>
                               <span th:if="${reviewVO.originalAmount}"
                                     th:text="|${#moneyUtil.parseToYuanStr(reviewVO.originalAmount)}|">
                               </span>
                            </td>
                            <td>
                                   <span th:if="${reviewVO.discountAmount}"
                                         th:text="|${#moneyUtil.parseToYuanStr(reviewVO.discountAmount)}|">
                                   </span>
                            </td>
                            <td>
                                   <span th:if="${reviewVO.totalAmount}"
                                         th:text="|${#moneyUtil.parseToYuanStr(reviewVO.totalAmount)}|">
                                   </span>
                            </td>
                            <td>
                                   <span id="internalTotalPrice" th:if="${reviewVO.internalTotalPrice}"
                                         th:text="|${#moneyUtil.parseToYuanStr(reviewVO.internalTotalPrice)}|">
                                   </span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-inline" style="color: #c2c2c2">内部价将用于：工程师和服务商的提留</div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 60px"><b>收费项目</b></label>
                <div class="layui-inline" style="width: 700px;">
                    <table class="layui-table table-text">
                        <thead>
                            <tr>
                                <th>项目名称</th>
                                <th>数量</th>
                                <th>外部价/单价</th>
                                <th>内部价/单价</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr th:each="serviceItem : ${reviewVO.orderServiceItemList}">
                                <td class="service-item-name" th:text="${serviceItem.servItemName}"></td>
                                <td class="item-number" th:text="${serviceItem.number}"></td>
                                <td class="layui-hide temp-total-price" th:text="${serviceItem.internalTotalPrice}"></td>
                                <td th:text="|${#moneyUtil.parseToYuanStr(serviceItem.externalSettlementPrice)}|"></td>
                                <td>
                                    <input th:data-service-item-id="${serviceItem.servItemId}"
                                           type="text" class="layui-input" name="internalSettlementPrice"
                                           th:value="|${#moneyUtil.parseToYuanStr(serviceItem.internalSettlementPrice)}|">
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>


            <div class="layui-form-item">
                <label class="layui-form-label" style="width: 60px">审核结果</label>
                <input type="radio"
                       name="serviceCompleteReviewStatus"
                       value="2"
                       title="审核成功"
                       lay-verify="otherReq"
                       lay-filter="reviewResult"
                       th:checked="${reviewVO.serviceCompleteReviewStatus == 2 ? true :false}">
                <input type="radio"
                       name="serviceCompleteReviewStatus"
                       value="3"
                       title="审核失败"
                       lay-verify="otherReq"
                       lay-filter="reviewResult"
                       th:checked="${reviewVO.serviceCompleteReviewStatus == 3 ? true :false}">
            </div>

            <div class="layui-form-item " id="fail-reason" style="display: none;">
                <label class="layui-form-label" style="width: 60px">失败缘由</label>
                <div class="layui-col-xs12 layui-col-sm6 layui-col-md3" th:each="item : ${reviewVO.auditReason}">
                    <input type="checkbox" lay-skin="primary" name="auditReason"  lay-filter="auditReason"
                           th:title="${item.text}"
                           th:value="${item.value}"
                           th:content="${item.ext1}">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" style="width: 60px">审核备注</label>
                <div class="layui-inline" style="width: 800px;">
                    <textarea id="content" name="content" class="layui-textarea" placeholder="请输入" maxlength="1000"></textarea>
                </div>
            </div>

            <div class="layui-form-item" style="text-align: center;margin-top: 30px;">
                <div class="layui-inline">
                    <button class="layui-btn layui-btn-normal" lay-submit>保存</button>
                </div>
            </div>
        </div>
    </form>

</div>

<script th:inline="javascript">

    var reviewVO = [[${reviewVO}]];
    var layuiModel = {
        oms_work_modify_servicecompletereview: "work/modify/zmn.oms.work.modify.servicecompletereview"
    };
</script>
</body>
</html>